#ifndef KEYPAD_H_
#define KEYPAD_H_

/* keypad.h                                                                   *
 * ========                                                                   *
 * Authors: Daniel North (08025562)                                           *
 * Creation Date: 07/02/2012                                                  *
 * Description:                                                               *
 * Contains macros, flags and function prototypes for polling of the keypad   *
 * register. Flags are set for each call to ReadKeypad().                     */                     

#include "globals.h"

/* Defines */
#define NUM_COLUMNS         4
#define COLUMN_MIN          0
#define COLUMN_MAX          3

/* References */
extern char keyp_base_left;
extern char keyp_base_right;
extern char keyp_shoulder_up;
extern char keyp_shoulder_down;
extern char keyp_elbow_up;
extern char keyp_elbow_down;
extern char keyp_gripper_close;
extern char keyp_home;
extern char keyp_record;
extern char keyp_play;
extern char keyp_record_end;
extern char keyp_test;

/* Read from the keypad - sets flags above if run is successful. */
#define KEYPAD_BUTTON_PRESSED         1
#define KEYPAD_BUTTON_NOT_PRESSED     0

int ReadKeypad(void);
char PlaybackKey(void);

#endif /*KEYPAD_H_*/
